function(CatCommonUsedVariableValue)
    message(STATUS ${PROJECT_NAME})
    message(STATUS ${CMAKE_PROJECT_NAME})
    message(STATUS ${CMAKE_CURRENT_SOURCE_DIR})
    message(STATUS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
    message(STATUS ${CURRENT_SRC_LIST})
endfunction(CatCommonUsedVariableValue)

get_cmake_property(_variableNames VARIABLES)
foreach (_variableName ${_variableNames})
    message(STATUS "${_variableName}=${${_variableName}}")
endforeach()

function(SelectPlatform CMAKE_BUILD_TYPE)
    message(STATUS "operation system is ${CMAKE_SYSTEM}")
    if(WIN32)  
        message(STATUS "platform is ${CMAKE_SYSTEM_NAME}")
    elseif(APPLE)  
        message(STATUS "platform is ${CMAKE_SYSTEM_NAME}")
    elseif(UNIX)  
        message(STATUS "platform is ${CMAKE_SYSTEM_NAME}")
        if(CMAKE_BUILD_TYPE STREQUAL "Debug")
            message("UNIX - Debug mode")
            # set(CMAKE_C_COMPILER C:\\Users\\stone\\AppData\\Local\\Packages\\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\\LocalState\\rootfs\\usr\\bin\\gcc)
            # set(CMAKE_CXX_COMPILER C:\\Users\\stone\\AppData\\Local\\Packages\\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\\LocalState\\rootfs\\usr\\bin\\g++)
            # set(CMAKE_C_COMPILER /usr/bin/gcc)         #这两个不注释，会在执行编译时产生循环性编译
            # set(CMAKE_CXX_COMPILER /usr/bin/g++)       #这两个不注释，会在执行编译时产生循环性编译
            set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -std=c99 -O2 -ggdb -Wall -pthread")
            set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11 -O2 -ggdb -Wall -Wunused-function -pthread")
            # set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb")
            # message(STATUS ${CXXFLAGS})
        elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
            message("UNIX - Release mode")
            set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -std=c99 -O2 -pthread")
            set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11 -O2 -Wunused-function -pthread")
            # set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
        endif()
    elseif(MINGW)
        if(CMAKE_BUILD_TYPE STREQUAL "Debug")
            set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11 -g -Wall -Wunused-function -pthread")
            set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -std=c99 -g -Wall -pthread")
            message("MINGW - Debug mode")
        elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
            set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11 -O2 -Wunused-function -pthread")
            set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -std=c99 -O2 -pthread")
            message("MINGW - Release mode")
        endif()
        if(PROJECT_ARCHITECTURE STREQUAL "x64")
            set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -m64")
            set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -m64")
        elseif(PROJECT_ARCHITECTURE STREQUAL "x86")
            set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -m32")
            set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -m32")
        endif()
        set(CMKAE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
    elseif(MSVC)
        if(CMAKE_BUILD_TYPE STREQUAL "Debug")
            set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ")
        elseif(CMKAE_BUILD_TYPE STREQUAL "Release")
            set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ")
        endif()
        if(CMAKE_CL_64)
            set(PROJECT_ARCHITECTURE "x64")
        else(CMAKE_CL_64)
            set(PROJECT_ARCHITECTURE "x86")
        endif(CMAKE_CL_64)
    endif()

    add_definitions(-fstack-protector-all -fPIC -D_FORTIFY_SOURCE=2 -O2 -Wunused-variable -D_GNU_SOURCE -D__USE_XOPEN -Wmissing-declarations)
    # CatCommonUsedVariableValue()
    execute_process(COMMAND "${CMAKE_COMMAND}" "-E" "environment")

endfunction()